export interface IAuthenticateCommand {
    command: "authenticate";
    resource: string;
    type: "SharePoint" | "Graph";
    claimsChallenge?: {
        claims: string;
        token?: string;
        error: any; // IError;
    };
    expiration?: {
        error: any; // IError;
    };
}

export type IThemeName =
    | "default"
    | "dark"
    | "lists"
    | "teams"
    | "teams-default"
    | "teams-dark"
    | "teams-contrast";

export interface ILayerConfiguration {
    mode?: "z-index" | "projection-frame" | "default";
    offset?: {
        top?: number;
        left?: number;
    };
}

export interface IBreadcrumbConfiguration {
    /**
     * Indicate whether set the root crumb folder path to the entry folder specified in IEntryConfiguration
     * TODO: deprecated. Should use root to specific the actual root crumb folder path.
     */
    setRootToEntry?: boolean;

    /**
     * Specify the root crumb folder path
     */
    root?: {
        sharePoint?: {
            byPath?: {
                web?: string;
                list?: string;
                folder?: string;
            };
        };
    };
}

/**
 * Configuration for communication between the host and the experience.
 * This must be specified in order to authenticate the experience, handle button clicks,
 * and receive data back.
 */
export interface IMessagingConfiguration {
    /**
     * A unique id assigned by the host app to this File Browser instance.
     * This should ideally be a new GUID generated by the host.
     */
    channelId: string;
    /**
     * The host app"s authority, used as the target origin for post-messaging.
     */
    origin: string;
    /**
     * Whether or not the host app window will need to identify itself.
     */
    identifyParent?: boolean;
    /**
     * Whether or not the client app must wait for a "configure" command to be sent by the host before rendering.
     */
    waitForConfiguration?: boolean;
    /**
     * Whether or not the client app can re-establish a connection to the host after a reload.
     */
    restartable?: boolean;
    /**
     * Override timeout for acknowledgement messages.
     */
    acknowledgeTimeout?: number;
    /**
     * Override timeout for the initialization handshake.
     */
    initializeTimeout?: number;
    /**
     * Override timeout for command responses.
     */
    resultTimeout?: number;
}

/**
 * Configures a pivot in the left-nav to behavior like a custom command.
 */
export interface IPivotCommandConfiguration {
    key?: string;
    action: "custom" | "open";
}

/**
 * Configures what types of items are allowed to be browsered, selected, and picked within the experience.
 * Note that the default configuration accounts for the expected authentication capabilities of the host app.
 * Depending on what else is enabled by the host, the host may be expected to provide tokens for more
 * services and scopes.
 */
export interface ITypesAndSourcesConfiguration {
    /**
     * Configures the base type of item which will be picked and displayed.
     * Only items of this general type will be selectable.
     */
    mode?: "files" | "folders" | "all";
    /**
     * `filters` options: file extension, i.e. .xlsx, .docx, .ppt, etc.
     * `filters` options: "photo", "folder", "video", "documentLibrary"
     */
    filters?: string[];
    /**
     * Specifies a filter for *where* the item may come from.
     */
    locations?: {
        /**
         * Items may only come from the user"s OneDrive.
         */
        oneDrive?: {};
        /**
         * Items may only come from a specific location within SharePoint.
         */
        sharePoint?: {
            byPath?: {
                web?: string;
                list?: string;
                folder?: string;
            };
        };
    };
    /**
     * Specifies which pivots the user may access while browsing files and lists.
     * Note that if a pivot is disabled here but still targeted in `entry`, it will still be visible
     * in the nav.
     */
    pivots?: {
        /**
         * Show "My files".
         */
        oneDrive?: boolean | IPivotCommandConfiguration;
        /**
         * Show "Photos". Consumer accounts only.
         */
        photos?: boolean | IPivotCommandConfiguration;
        /**
         * Show "Recent".
         */
        recent?: boolean | IPivotCommandConfiguration;
        /**
         * Show "Shared"
         */
        shared?: boolean | IPivotCommandConfiguration;
        /**
         * Show "Mobile device". The host app must be able to authenticate this service separately.
         */
        phoneLink?: boolean;
        /**
         * Show "Communities". The host app must be Yammer.
         */
        yammerCommunities?: boolean;
        /**
         * Show "Cloud storage". The host app must be Teams.
         */
        teamsCloudStorage?: boolean;
        /**
         * Show "Quick access".
         */
        sharedLibraries?: boolean;
        /**
         * Show "Stock images".
         */
        stockImages?: boolean;
        /**
         * Show "Bing search".
         */
        bing?: boolean;
        /**
         * Show "My lists".
         */
        myLists?: boolean;
    };
}

export interface IAccessibilityConfiguration {
    /**
     * Whether or not to "trap focus" within the component. If this is enabled, tab-stops will loop from
     * the last element back to the left navigation automatically. This is useful if the components"s frame
     * is hosted as the only content of a modal overlay and focus should not jump to the outside content.
     *
     * @default `false`
     */
    enableFocusTrap?: boolean;
    /**
     * Whether or not the component should immediately grab focus once the content has loaded.
     *
     * @default `true`
     */
    trapFocusOnLoad?: boolean;
    /**
     * Whether or not to force the currently-focused element within the component to be highlighted.
     * By default, the focused element is highlighted if the user navigates elements with the keyboard
     * but not when the user interacts via the mouse. However, if a host application launches the component
     * due to keyboard input is should set this flag to `true` to ensure continuity of behavior.
     *
     * @default `false`
     */
    showFocusOnLoad?: boolean;
}

export type FilePickerPickAction = "select" | "share" | "download" | "move";

/**
 * Configuration for the entry location to which the File Browser will navigate on load.
 * The File Browser app will prioritize path-based navigation if provided, falling back to other address forms
 * on error (in case of Site redirection or content rename) or if path information is not provided.
 */
export interface IEntryConfiguration {
    sharePoint?: {
        /**
         * Specify an exact SharePoint content location by path segments.
         */
        byPath?: {
            /**
             * Full URL to the root of a Web, or server-relative URL.
             * @example
             *  "https://contoso-my.sharepoint.com/personal/user_contoso_com"
             * @example
             *  "/path/to/web"
             * @example
             *  "subweb"
             */
            web?: string;
            /**
             * Full URL or path segement to identity a List.
             * If not preceded with a `/` or a URL scheme, this is assumed to be a list in the specified web.
             * @example
             *  "Shared Documents"
             * @example
             *  "/path/to/web/Shared Documents"
             * @example
             *  "https://contoso.sharepoint.com/path/to/web/Shared Documents"
             */
            list?: string;
            /**
             * Path segment to a folder within a list, or a server-relative URL to a folder.
             * @example
             *  "General"
             * @example
             *  "foo/bar"
             * @example
             *  "/path/to/web/Shared Documents/General"
             */
            folder?: string;
            /**
             * Auto fallback to root folder if the specified entry sub folder doesn"t exist.
             */
            fallbackToRoot?: boolean;
        };
        /**
         * Indicates SharePoint ID values which may be used as a backup in case path-based navigation to the initial item fails.
         * Id-based lookup in SharePoint is slower, as should only be used as a last-resort.
         * The File Browser will return an error if only ID values are specified.
         */
        byId?: {
            webId?: string;
            listId?: string;
            uniqueId?: string;
        };
    };
    /**
     * Indicates that the File Browser should start in the user"s OneDrive.
     */
    oneDrive?: {
        /**
         * Specifies that File Browser should start in the user"s Files tab.
         */
        files?: {
            /**
             * Path segment for sub-folder within the user"s OneDrive.
             * @example
             *  "Pictures"
             * @example
             *  "/personal/user_contoso_com/Documents/Attachments"
             */
            folder?: string;
            /**
             * Auto fallback to root folder if the specified entry sub folder doesn"t exist.
             */
            fallbackToRoot?: boolean;
        };
        /**
         * Indicates that File Browser should start in the user"s recent files.
         */
        recent?: {};
        /**
         * Indicates that File Browser should start in the files shared with the user.
         */
        sharedWithMe?: {};
        /**
         * Indicates that File Browser should start in the phone link data.
         */
        phoneLink?: {};
        /**
         * Indicates that File Browser should start in the user"s photos.
         */
        photos?: {};
        /**
         * Indicates that File Browser should start in the user"s lists.
         */
        myLists?: {};
    };

    /**
     * If the entry location is to be loaded via a shortcut lens, where was the shortcut from?
     */
    shortcut?: {
        sharePoint?: {
            byPath?: {
                web?: string;
                list?: string;
                folder?: string;
            };
        };

        teamChannel?: {
            web?: string;
            list?: string;
            groupId?: string;
            channelId?: string;
            displayName?: string;
        };

        graph?: {
            byId?: {
                driveId?: string;
                itemId?: string;
            };
        };
    };

    /**
     * If the entry location is to be rendered in a OneUp configuration, what item should be "focused"?
     * The specified item will be rendered in context of the main item"s children.
     */
    focus?: {
        sharePoint?: {
            byPath?: {
                web?: string;
                list?: string;
                folder?: string;
            };
        };

        graph?: {
            byId?: {
                driveId?: string;
                itemId?: string;
            };
        };
    };

    graph?: {
        byId?: {
            /**
             * Id of the drive on Graph, or "me" for the user"s OneDrive. Assumed to be "me" if empty.
             */
            driveId?: string;
            /**
             * Id of the item on Graph, or a special identifier such as "root". Assumed to be "root" if empty.
             */
            itemId?: string;
        };
    };

    sortBy?: {
        /**
         * Name of the field *in SharePoint* on which to sort.
         */
        fieldName: string;
        /**
         * Whether or not to sort in ascending order. Default is `true`.
         */
        isAscending?: boolean;
    };

    filterBy?: {
        /**
         * Name of the field *in SharePoint* on which to filter on.
         */
        fieldName: string;
        /**
         * Filter value
         */
        value: string;
    };

    // TBD Specifying group/filter/view settings.
    view?: {
        /**
         * Id of the view to start with
         */
        id?: string;
    };
}

/**
 * Configures how commands behave within the experience.
 */
export interface ICommandsConfiguration {
    /**
     * Overrides the "open" behavior for files and folders.
     */
    open?: {
        /**
         * Specifies a series of "handlers" for clicking files and folders.
         * For each handler, the invoked item is tested against `filters`,
         * and the first matching handler has its behavior applied.
         * If no handler matches, the default behavior applies.
         */
        handlers?: {
            filters?: string[];
            /**
             * Specifies the target for opening the item
             * - `none`: Do not allow the item to be opened.
             * - `navigate`: Open the item within the experience.
             * - `external`: Open the item in a new tab.
             * - `host`: Ask the host to open the item.
             */
            target?: "none" | "navigate" | "external" | "host";
        }[];
    };
    /**
     * Overrides behaviors for the view-switch dropdown.
     */
    switchView?: {
        enabled?: boolean;
        views: {
            smartTemplate?: boolean; // default false
        };
    };
    /**
     * Overrides behaviors for editing SharePoint views.
     */
    editView?: {
        enabled?: boolean;
    };
    /**
     * Overrides behaviors for creating SharePoint views.
     */
    createView?: {
        enabled?: boolean;
    };
    /**
     * Specifies the behavior for file-picking.
     */
    pick?: {
        /**
         * A special action to perform when picking the file, before handing the result
         * back to the host app.
         */
        action?: FilePickerPickAction;
        /**
         * A custom label to apply to the button which picks files.
         * This must be localized by the host app if supplied.
         */
        label?: string;
        /**
         * Configures the "move" action for picking files.
         */
        move?: {
            sourceItems?: IItem[];
        };
        /**
         * Configures the "copy" action for picking files.
         */
        copy?: {
            sourceItems?: IItem[];
        };
        /**
         * Configures the "select" action for picking files.
         */
        select?: IFilePickerPickCommandSelectOptions;
        /**
         * Configures special handling for custom lists.
         */
        listItem?: {
            fieldName?: string;
        };
    };
    /**
     * Specifies the behavior for closing the experience.
     */
    close?: {
        /**
         * A custom label to apply to the "cancel" button.
         * This must be localized by the host app if supplied.
         */
        label?: string;
    };
    /**
     * Behavior for a "Browse this device" command to pick local files.
     */
    browseThisDevice?: {
        enabled?: boolean;
        label?: string;
    };
    /**
     * Behavior for a "From a link" command to pick from a link.
     */
    fromALink?: {
        enabled?: boolean;
    };
    /**
     * Behavior for a "Switch account" command.
     */
    switchAccount?: {
        mode?: "host" | "none";
    };
    /**
     * Behavior for a "Manage accounts" command.
     */
    manageAccounts?: {
        mode?: "host" | "none";
        label?: string;
    };
    /**
     * Behavior for "Upload"
     */
    upload?: {
        enabled?: boolean;
    };
    /**
     * Behavior for "Create folder"
     */
    createFolder?: {
        enabled?: boolean;
    };
    /**
     * Behavior for "Filter by" in the column headers.
     */
    filterByColumn?: {
        mode?: "panel" | "menu";
    };
    /**
     * Configuration for a command to open the current item in the full SharePoint site.
     */
    openInSharePoint?: {
        enabled?: boolean;
        location?: "header" | "command-bar";
    };
    /**
     * How to handle "Open in Desktop" protocol callbacks
     */
    openInDesktop?: {
        /**
         * @default "inline"
         */
        mode: "external" | "inline" | "host" | "none";
    };
    /**
     * How to handle actions defined by custom formatters.
     */
    customFormatter?: {
        actions?: {
            key: string;
            mode?: "host" | "none";
        }[];
    };
    /**
     * How to handle specified values for `key` in custom commands
     * in the tray, nav, or command bar.
     */
    custom?: {
        actions?: ICustomCommandActionConfiguration[];
    };
}

export interface IFilePickerPickCommandSelectOptions {
    urls?: {
        download?: boolean;
    };
}

export interface ICustomCommandActionConfiguration {
    key: string;
    /**
     * Filters defining what types of items the action operates on.
     * If specified, the action will only be available for items which match the given filters.
     */
    filters?: string[];
    /**
     * How the action is invoked.
     * "host": Invokes a `custom` command message against the host app.
     * "none": Disables the action.
     */
    mode?: "host" | "none";
    /**
     * Selection criteria to which the item applies.
     */
    selection?: "single" | "multiple" | "current" | "none";
}

export type ListLayoutType = "details" | "compact-details" | "tiles";

export interface IListConfiguration {
    /**
     * A custom override for the initial list layout.
     */
    layout?: {
        /**
         * Sets the preferred starting layout for the initial content.
         */
        type?: ListLayoutType;
    };
    /**
     * Configures scrolling behavior within the Browser.
     */
    scrolling?: {
        enableStickyHeaders?: boolean;
    };
}

/**
 * Configuration for handling authentication requests from the embedded app.
 * Presence of this object (even if empty) indicates that the host will handle authentication.
  */
export interface IAuthenticationConfiguration {}

export interface IMessageBase {
    // Empty.
}

export interface IInitializeMessage extends IMessageBase {
    type: "initialize";
    channelId: string;
    replyTo: MessagePort;
}

export interface IActivateMessage extends IMessageBase {
    type: "activate";
}

export interface IAcknowledgeMessage extends IMessageBase {
    type: "acknowledge";
}

export type IMessage =
    | INotificationMessage
    | ICommandMessage;

export interface IFileBrowserCommandBase {
    // Empty.
}

export interface IFileBrowserNotificationBase {
    // Empty.
}

export interface IFileBrowserResultBase {
    // Empty.
}

export interface IFileBrowserDownloadCommand extends IFileBrowserCommandBase {
    command: "download";
}

export interface IOpenedItem extends IItem {
    /**
     * The SharePoint endpoint which should be used to retrieve the item"s information.
     * Typically the root domain and the `/_api/v2.0` suffix.
     */
    "@sharePoint.endpoint"?: string;
    "@sharePoint.embedUrl"?: string;
    "@sharePoint.listUrl"?: string;
}

export interface IFileBrowserOpenCommand extends IFileBrowserCommandBase {
    command: "open";
    item: IOpenedItem;
}

export interface IFileBrowserNavigateCommand extends IFileBrowserCommandBase {
    command: "navigate";
}

export type TokenName =
    | "ms-graph"
    | "ms-loki"
    | "ms-mcu"
    | "ms-officeapps"
    | "ms-substrate"
    | "ms-substrate-sti"
    | "ms-substrate-tenant-feedback"
    | "power-bi"
    | "oAuth"
    | "yammer"
    | "your-phone"
    | "SPHome"
    | "SharePoint"
    | "SharePoint-graph"
    | "SharePoint-media"
    | "SharePoint_SelfIssued"
    | "pushchannel"
    | "teams-cmd"
    | "ocps";

export interface IFileBrowserAuthenticateCommand extends IFileBrowserCommandBase {
    command: "authenticate";
    resource: string;
    type: TokenName;
}

export interface IFileBrowserAuthenticateResult {
    result: "token";
    token: string;
    scheme?: "Bearer";
    /**
     * A string containing a UTC ISO timestamp for when the token is expected to expire.
     * For standard JWT tokens, the Browser will extract this value directly from the token.
     */
    expires?: string;
}

export interface IFileBrowserConfigureCommand extends IFileBrowserCommandBase {
    command: "configure";
    fileBrowser: Omit<IFileBrowserOptions, "sdk" | "messaging" | "authentication" | "entry" | "telemetry">;
}

/**
 * Tells the File Browser to initiate the page-load flow using its already-configured `entry` item.
 * To change the entry item, send a `configure` message with an updated value for `entry`.
 */
export interface IFileBrowserLoadPageCommand extends IFileBrowserCommandBase {
    command: "load-page";
    /**
     * Timestamp, e.g. `Date.now()`, at which the user initiated the action to trigger a page load.
     */
    timestamp?: number;
}

/**
 * Tells the File Browser to "unload" the current item, reset page-load state,
 * and de-render any "expensive" memory-consuming content.
 *
 * The Browser will respond once the content has been de-rendered.
 */
export interface IFileBrowserUnloadPageCommand extends IFileBrowserCommandBase {
    command: "unload-page";
}

/**
 * Command sent from the File Browser to tell its host that the user wishes it to be closed.
 * The host is expected to de-render the iframe before resolving the command, or respond with an error.
 */
export interface IFileBrowserCloseCommand extends IFileBrowserCommandBase {
    command: "close";
}

export interface IFileBrowserInvokeCustomFormatterActionCommand extends IFileBrowserCommandBase {
    command: "invoke-custom-formatter-action";
    /**
     * Key of the custom command as given in Custom Formatter JSON
     */
    key: string;
    /**
     * The selected items
     */
    items: IItem[];
}

export interface IFileBrowserToggleLeftNavCommand extends IFileBrowserCommandBase {
    command: "toggle-left-nav";
    /**
     * Preferred modal state for the nav, if present.
     */
    modality?: "modal" | "hidden";
}

export interface IFileBrowserCustomCommand extends IFileBrowserCommandBase {
    command: "custom";
    key: string;
}

export interface IFileBrowserSelectItemsCommand extends IFileBrowserCommandBase {
    command: "select-items";
    items: IItem[];
}

export type IFileBrowserCommand =
    | IFileBrowserDownloadCommand
    | IFileBrowserNavigateCommand
    | IFileBrowserOpenCommand
    | IFileBrowserAuthenticateCommand
    | IFileBrowserConfigureCommand
    | IFileBrowserCloseCommand
    | IFileBrowserLoadPageCommand
    | IFileBrowserUnloadPageCommand
    | IFileBrowserInvokeCustomFormatterActionCommand
    | IFileBrowserToggleLeftNavCommand
    | IFileBrowserCustomCommand
    | IFileBrowserSelectItemsCommand;

export interface ICommandMessage {
    type: "command";
    id: number;
    data: IFileBrowserCommand;
}

export interface IFileBrowserLayerAddedNotification {
    notification: "layer-added";
    count: number;
}

export interface IFileBrowserLayerRemovedNotification {
    notification: "layer-removed";
    count: number;
}

export interface IFileBrowserPageLoadedNotification {
    notification: "page-loaded";
    timestamp: number;
    error?: IError;
}

export interface IFileBrowserNavigationStartedNotification {
    notification: "navigation-started";
    timestamp: number;
}

export interface IFileBrowserNavigationEndedNotification {
    notification: "navigation-ended";
    timestamp: number;
    error?: IError;
}

export interface IFileBrowserItemEditBase {
    item: IItem;
}

export interface IFileBrowserItemEditDelete extends IFileBrowserItemEditBase {
    edit: "delete";
}

export interface IFileBrowserItemEditRename extends IFileBrowserItemEditBase {
    edit: "rename";
    rename: {
        fromName: string;
        toName: string;
    };
}

export interface IFileBrowserItemEditUpdate extends IFileBrowserItemEditBase {
    edit: "update";
}

export interface IFileBrowserItemEditUpload extends IFileBrowserItemEditBase {
    edit: "create";
}

export type IFileBrowserItemEdit =
    | IFileBrowserItemEditDelete
    | IFileBrowserItemEditRename
    | IFileBrowserItemEditUpdate
    | IFileBrowserItemEditUpload;

export interface IFileBrowserItemsEditedNotification {
    notification: "items-edited";
    edits: IFileBrowserItemEdit[];
}

export interface IFileBrowserItemsSelectedNotification {
    notification: "items-selected";
    count: number;
}

export type IFileBrowserNotification =
    | IFileBrowserPageLoadedNotification
    | IFileBrowserNavigationStartedNotification
    | IFileBrowserNavigationEndedNotification
    | IFileBrowserItemsEditedNotification
    | IFileBrowserItemsSelectedNotification
    | IFileBrowserLayerAddedNotification
    | IFileBrowserLayerRemovedNotification;

export interface INotificationMessage {
    type: "notification";
    data: IFileBrowserNotification;
}

export interface IFileBrowserSuccessResult extends IFileBrowserResultBase {
    // Empty.
}

export interface IError {
    code: string;
    message: string;
    isExpected?: boolean;
}

export interface IFileBrowserErrorResult extends IFileBrowserResultBase {
    error: IError;
}

export type IFileBrowserResult =
    | IResult
    | IFileBrowserSuccessResult
    | IFileBrowserErrorResult
    | IFileBrowserAuthenticateResult;

export interface IResultMessage {
    type: "result";
    id: number;
    data: IFileBrowserResult;
}

export interface IViewsConfiguration {
    smartTemplate?: {
        customFields: string[];
    };
}

export interface ILeftNavConfiguration {
    /**
     * Whether or not a Left Nav should be rendered by the embedded content.
     */
    enabled?: boolean;
    /**
     * Mode of presentation of the nav.
     * If the nav is enabled but this is set to `host`, the embedded app
     * will show a button to ask the host app to show a nav.
     */
    mode?: "host" | "default";
    /**
     * Indicates whether the left nav will be initially modal.
     */
    initialModality?: "modal" | "hidden";

    /**
     * Type of left nav
     */
    preset?: "oneDrive" | "current-site";

    /**
     * Custom commands to insert at the end of the left nav. Will appear before the default set.
     */
    commands?: ILeftNavCommandConfiguration[];
}

export interface ILeftNavCommandConfiguration {
    /**
     * Name to use when notifying the host that the command is being invoked.
     */
    key: string;
    /**
     * Localized string to use for the button text.
     */
    label: string;
    /**
     * Type of action which will be performed when the command is clicked.
     * "custom": Configured via `commands.custom`.
     */
    action: "custom" | "pick" | "close" | "browse-this-device";
    /**
     * Name of a Fluent icon to use for the command button.
     */
    icon?: string;
}

export interface IFileBrowserOptions {
    sdk: "1.0" | "v1.0" | "8.0" | "v8.0";
    messaging: IMessagingConfiguration;
    entry?: IEntryConfiguration;
    authentication?: IAuthenticationConfiguration;
    breadcrumb?: IBreadcrumbConfiguration;
    commands?: ICommandsConfiguration;
    typesAndSources?: ITypesAndSourcesConfiguration;
    accessibility?: IAccessibilityConfiguration;
    leftNav?: ILeftNavConfiguration;
    list?: IListConfiguration;
    layer?: ILayerConfiguration;
}

/**
 * Result used to indicate that the command succeeded.
 */
export declare interface ISuccessResult {
    /**
     * The type of the result. Should be 'success'.
     * @type {'success'}
     */
    result: 'success';
}

/**
 * Result used to indicate that command failed.
 */
export declare interface IErrorResult {
    /**
     * The type of the result. Should be 'error'.
     * @type {'error'}
     */
    result: 'error';
    /**
     * Whether the error should be considered expected or unexpected. Used as part of measuring the reliability of the command.
     * @type {boolean}
     */
    isExpected: boolean;
    /**
     * Detailed error information.
     */
    error: {
        /**
         * Short error code. Used to group similar errors for telemetry purposes. Will be logged and should not contain PII.
         * @type {string}
         */
        code: string;
        /**
         * Detailed error message. Will be logged and should not contain PII.
         * @type {string}
         */
        message: string;
    };
}
/**
 * Extended error type with data for Quality of Service tracking.
 */
export declare type IQosError = Error & {
    /**
     * Error code for this error. Defaults to the `.name` property.
     * @type {string}
     */
    code?: string;
    /**
     * Whether or not this error was expected. If not provided, defaults to `false`.
     * @type {boolean}
     */
    isExpected?: boolean;
};
/**
 * Error codes that the hosts/clients are expected to recognize. Consumers may provide additional codes,
 * but should use codes in this set when they apply.
 */
export declare const ErrorCodes: {
    /**
     * Indicates that the received command is unknown.
     */
    readonly unsupportedCommand: "unsupportedCommand";
    /**
     * Indicates that the command handler threw an error.
     */
    readonly handlerError: "handlerError";
    /**
     * Indicates that the command handler rejected the promise, but did not specify an error.
     */
    readonly handlerRejection: "handlerRejection";
    /**
     * Indicates that the communication layer timed out while waiting for an acknowledgement.
     */
    readonly acknowledgeTimeout: "acknowledgeTimeout";
    /**
     * Indicates that the communication layer timed out while waiting for a result.
     */
    readonly resultTimeout: "resultTimeout";
    /**
     * Indicates that the communication layer timed out during initialization.
     */
    readonly setupTimeout: "setupTimeout";
    /**
     * Indicates that the promise was canceled.
     */
    readonly canceled: "canceled";
    /**
     * Indicates that a method was invoked on a disposed object.
     */
    readonly disposed: "disposed";
};
/**
 * A result from a command.
 */
export declare type IResult = ISuccessResult | IErrorResult;

export interface IItem {

}
